import template2tokens from './template2tokens'
import renderTemplate from './renderTemplate'

export default function engine(templateStr, data) {
  let tokens = template2tokens(templateStr)
  return renderTemplate(tokens, data)
}